﻿using King.Box.Models.Db.Sys;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace King.Box.Models.View.Sys
{
    [NotMapped]
    public class Sys_MenuData : Sys_Menu
    {
        [JsonIgnore]
        public Sys_MenuData Parent { get; set; }
        public string LevelName { get; set; }
        public List<Sys_MenuData> SubMenus { get; set; }
        public bool HasParent
        {
            get
            {
                return this.Parent != null;
            }
        }
        public bool HasSubMenu
        {
            get
            {
                return this.SubMenus != null && this.SubMenus.Count > 0;
            }
        }
    }
}
